package jp.sourceforge.akjrcp.ui.draw2d;

public abstract class TimeBasedFigure extends DoubleScalableFigure{
	protected double splitFrame;//should change
	public TimeBasedFigure(int defaultWidth, int defaultHeight,double splitFrame) {
		super(defaultWidth, defaultHeight);
		this.splitFrame=splitFrame;
	}
	
	 public int calculateTimeToX(long millisecond){
     	return (int)(millisecond*this.getHorizontalScale()/splitFrame/1000);
     }
	 
	 public int calculateTimeToX(double second){
	     	return (int)(second*this.getHorizontalScale()/splitFrame);
	     }
	 
	 public void setScale(double w,double h){
         super.setScale(w,h);
         updateScale();
     }
	 
	 public abstract void updateScale();

}
